﻿using MRGSP.SurveyMaster.Core.Model;
using MRGSP.SurveyMaster.Core.Repository;
using MRGSP.SurveyMaster.Core.Security;
using MRGSP.SurveyMaster.Data;
using MRGSP.SurveyMaster.Infra;
using MRGSP.SurveyMaster.Infra.Dto;
using MRGSP.SurveyMaster.WebUI.Controllers;
using Omu.ValueInjecter;

namespace MRGSP.SurveyMaster.WebUI
{
    public class WindsorConfigurator
    {
        public static void Configure()
        {
            WindsorRegistrar.RegisterControllers(typeof(HomeController).Assembly);
            WindsorRegistrar.RegisterAllFromAssemblies("MRGSP.SurveyMaster.Data", "MRGSP.SurveyMaster.Core");
            WindsorRegistrar.RegisterAllFromAssemblies("MRGSP.SurveyMaster.Service", "MRGSP.SurveyMaster.Core");
            WindsorRegistrar.Register("forms", typeof(IFormsAuthentication), typeof(FormAuths));
            WindsorRegistrar.Register("injecter", typeof(IValueInjecter), typeof(ValueInjecter));            
            WindsorRegistrar.Register("repo", typeof(IRepo<>), typeof(Repo<>));            

            WindsorRegistrar.Register("ucb", typeof(IBuilder<User,UserCreateInput>), 
                typeof(UserCreateBuilder));
            WindsorRegistrar.Register("ueb", typeof(IBuilder<User, UserEditInput>),
                typeof(UserEditBuilder));            
        }
    }
}